import request from '../utils/myaxios'
// 1.用户登陆
export const userLoginAPI = (data) => {
    return request({
        method:'POST',
        url:'/login',
        data:data,
    })
}
// 用户详情1
export const userDetaiAPI = (id) => {
    return request({
        method:'GET',
        url:`/user/${id}`,
        
    })
}
// 获取文章数据
export const getPostAPI = (params) => {
    return request({
      method:"GET",
      url:'/post',
      params:params,
    })
  }
//   发布文章
export const PostEssayAPI = (data) => {
    return request({
      method:"POST",
      url:`/post`,
      data:data,
    })
  }
  // 获取栏目数据
export const getCategoryAPI = () => {
    return request({
      url:'/category',
    })
  }
  // 添加栏目数据
export const PostCategoryAPI = (data) => {
    return request({
      method:"POST",
      url:'/category',
      data:data
    })
  }
  // 文章详情
export const getPosDetatAPI = (id) => {
  return request({
    method:"GET",
    url:`/post/${id}`,
  })
}
// 文章编辑
export const PostBjianEssayAPI = (data,id) => {
  return request({
    method:"POST",
    url:`/post_update/${id}`,
    data:data,
  })
}